<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head> 
   <meta charset="UTF-8">
   <%@ include file="/WEB-INF/views/include/head.jsp"%>
   <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
   <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css">
   <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
   <script src="${ctxStatic}/js/layer.js"></script>
   <script src="${ctxStatic}/js/style.js"></script>
   <script src="${ctxStatic}/jquery-barcode/jquery-barcode.js" type="text/javascript"></script>
   <script type="text/javascript">
     $(document).ready(function(){
         
     });
     function checkComplete(){
    	if (confirm("<spring:message code='stockCheck_detail_areyousure'/>")) {
    		var id = $("#id").val();
    		var warehouseID = $("#warehouseID").val();
    		$.post("${ctx}/stock/check/checkComplete?id="+id+"&warehouseID="+warehouseID,"", function(result) {
    			tipParent(result.message);
    			window.parent.frames[0].searchListForm();
    			closeWin();
    		}, 'json');
		}
     }
      
      
	</script>
</head>
<body>
<div class="layerHeader clearfix">
	<input type="hidden" id="id" value="${stockCheck.id }"/>
	<input type="hidden" id="warehouseID" value="${stockCheck.warehouseID }"/>
	<p class="headerTitle"><spring:message code="stockCheck_detail_takeDetail"/></p>
    <div class="headerButton clearfix">
    <c:if test="${stockCheck.checkStatus == '0'}">
    	<!-- 导入 -->
    	<button onclick="popup('500px','150px','${ctx}/stock/check/importExcel?stockCheckID=${stockCheck.id }');"><spring:message code="stockCheck_detail_import"/></button>
    	<!-- 导出 -->
    	<button onclick="window.location.href='${ctx}/stock/check/exportFile?id=${stockCheck.id }&warehouseName=${stockCheck.warehouseName}'"><spring:message code="stockCheck_detail_export"/></button>
    	<!-- 盘点完成 -->
    	<button onclick="checkComplete();"><spring:message code="stockCheck_detail_complete"/></button>
    	<%-- <!-- 盘盈入库 -->
    	<button onclick=""><spring:message code="stockCheck_detail_in"/></button>
    	<!-- 盘亏出库 -->
    	<button onclick=""><spring:message code="stockCheck_detail_out"/></button> --%>
    </c:if>
        <!-- 取消 -->
        <button onclick="closeWin()"><spring:message code="btn_cancle"/></button>
    </div>
</div>
<div class="smOrderBox">
    <div class="items clearfix">
        <div class="col-33 clearfix">
            <!-- 仓库名称 -->
            <p class="tit"><spring:message code="stockCheck_detail_warehouseName"/></p>
            <p>${stockCheck.warehouseName}</p>
        </div>
        
    </div>
    
</div>
<div class="tableArea">
    <div class="tableScrollSm" style="overflow:auto;width:885px;height:470px;">
        <table cellpadding="0" class="tableHead">
            <thead>
            <tr>
            	<!-- No. -->
                <th><p class="width-50px"><spring:message code="common_no"/></p></th>
                <!-- 货架位置 -->
                <th><p class="width-200px"><spring:message code="stockCheck_detail_rackPlace"/></p></th>
                <!-- 面料code -->
                <th><p class="width-200px"><spring:message code="stockCheck_detail_material"/></p></th>
                <!-- 库存数量 -->
                <th><p class="width-120px"><spring:message code="stockCheck_detail_materialQuantity"/></p></th>
                <!-- 实际数量 -->
                <th><p class="width-120px"><spring:message code="stockCheck_detail_realQuantity"/></p></th>
                <!-- 盘点 -->
                <th><p class="width-100px"><spring:message code="stockCheck_detail_take"/></p></th>
                <!-- 处理 -->
                <th class="width-70px"><spring:message code="stockCheck_detail_manage"/></th>
            </tr>
            </thead>
        </table>
        <table cellpadding="0" class="tableBody">
            <tbody>
            <c:forEach items="${takeDetailList}" var="tdetail" varStatus="status">
            <tr>
                <td><p class="width-50px">${status.count }</p></td>
                <td><p class="width-200px">${tdetail.rackPlace}</p></td>
                <td><p class="width-200px">${tdetail.materialCode}</p></td>
                <td><p class="width-120px"><fmt:formatNumber value="${tdetail.checkQuantity}" pattern="#,##0.000#"/></p></td>
                <td><p class="width-120px"><fmt:formatNumber value="${tdetail.realQuantity}" pattern="#,##0.000#"/></p></td>
                <td><p class="width-100px"><c:if test="${tdetail.realQuantity != null &&tdetail.realQuantity != ''}"><fmt:formatNumber value="${tdetail.takeQuantity}" pattern="#,##0.000#"/></c:if></p></td>
                <td><p class="width-70px">
                <c:if test="${tdetail.realQuantity != null &&tdetail.realQuantity != ''}">
                	<c:if test="${tdetail.takeQuantity<0}">
                		<spring:message code="stockCheck_detail_gain"/>
                	</c:if>
                	<c:if test="${tdetail.takeQuantity>0}">
                		<spring:message code="stockCheck_detail_loss"/>
                	</c:if>
                	<c:if test="${tdetail.takeQuantity==0}">
                		<spring:message code="stockCheck_detail_equal"/>
                	</c:if>
                </c:if></p></td>
            </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>